function parse(url) {
    const urlArr = url.split('?')
    const param = urlArr[1].split('&').map(item => item.split('='))
    const res = {}
        param.forEach(item => {
        res[item[0]] = item[1]
    })
    return res
}

console.log(parse('http://www.baidu?a=1&b=1&c=4'));